package mmc.server.shell.ops.utility;

import mmc.server.Server;
import mmc.server.shell.ShellException;
import mmc.server.shell.ops.Function;

public class GetBlock extends Function {

    public GetBlock(String text) throws ShellException {
        super(text, "getblock", 3, false);
    }

	@Override
    public double execute() {
    	return Server.instance.getScene().getCellManager().getEnclosingBlock(
    			(float)arguments.getCalculatedArgument(0), 
    			(float)arguments.getCalculatedArgument(1),
    			(float)arguments.getCalculatedArgument(2));
    }
    
    public static String getDescription(){
    	return formatHelpString("getBlock(x,y,z)","reads a block's id");
    }

}
